Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export the Viz type #225

Merged
merged 1 commit into from
Jan 5, 2024
Merged

Export the Viz type #225

merged 1 commit into from
Jan 5, 2024

Conversation

mdaines
Copy link
Owner

@mdaines mdaines commented Dec 28, 2023

This adds an export for the Viz type to the declaration file for the viz package. The class itself isn't exported in JavaScript, but TypeScript users may want to refer to the type when dealing with instances of the class.

For example, a wrapper function that accepts an instance of Viz:

import { type Viz } from "@viz-js/viz";

export function myRender(viz: Viz, src: string): string {
  return viz.renderString(src, { graphAttributes: { label: "My graph" } });
}

@mdaines mdaines mentioned this pull request Dec 28, 2023
@mdaines mdaines merged commit ab72f38 into v3 Jan 5, 2024
4 checks passed
@mdaines mdaines deleted the export-viz-type branch January 5, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant